	// 注意：纯前端实现图片合成视频功能有限，通常需要后端配合
// 以下代码提供基本思路，但实际应用中可能需要使用WebCodecs API、FFmpeg.wasm或后端服务

	// 注意：此代码为概念性实现，在浏览器环境中无法直接运行
// 需要配合适当的库和后端支持

	async function downloadImagesAndCreateVideo(imageUrls, options = {}) {
		const {
			fps = 30,
			width = 1280,
			height = 720,
			outputFilename = 'output.mp4'
		} = options;

		// 创建画布用于绘制图片
		const canvas = document.createElement('canvas');
		canvas.width = width;
		canvas.height = height;
		const ctx = canvas.getContext('2d');
		
		let div = document.querySelector('.plyr__video-wrapper');
		div.appendChild(canvas);

		// 创建媒体录制器
		const stream = canvas.captureStream(fps);
		const mediaRecorder = new MediaRecorder(stream, {
			mimeType: 'video/webm;codecs=vp9',
			videoBitsPerSecond: 2500000
		});

		const chunks = [];
		mediaRecorder.ondataavailable = (e) => {
			if (e.data.size > 0) {
				chunks.push(e.data);
			}
		};

		mediaRecorder.onstop = () => {
			const blob = new Blob(chunks, { type: 'video/webm' });
			const url = URL.createObjectURL(blob);
			const a = document.createElement('a');
			a.href = url;
			a.download = outputFilename;
			a.click();
			URL.revokeObjectURL(url);
			
			// div.removeChild(canvas);
		};

		// 开始录制
		mediaRecorder.start();

		try {
			for (let i = 0; i < imageUrls.length; i++) {
				const img = await loadImage(imageUrls[i]);
				
				// 绘制图片到画布
				ctx.clearRect(0, 0, width, height);
				ctx.drawImage(img, 0, 0, width, height);
				
				// 等待一帧的时间
				await new Promise(resolve => setTimeout(resolve, 1000 / fps));
				
				console.log(`Processed image ${i + 1}/${imageUrls.length}`);
			}
		} catch (error) {
			console.error('Error processing images:', error);
		} finally {
			// 停止录制
			mediaRecorder.stop();
		}

		// 图片加载函数
		function loadImage(url) {
			return new Promise((resolve, reject) => {
				const img = new Image();
				//img.crossOrigin = 'anonymous';
				img.onload = () => resolve(img);
				img.onerror = reject;
				img.src = url;
			});
		}
	}
	
	function testImagesAndCreateVideo(){
			// 使用示例
		const imageUrls = [
				"https://nineyu.com/fa2d4a35-0281-4d90-b71f-438e32892df8/seek/_0.jpg",
				"https://nineyu.com/fa2d4a35-0281-4d90-b71f-438e32892df8/seek/_1.jpg",
				"https://nineyu.com/fa2d4a35-0281-4d90-b71f-438e32892df8/seek/_2.jpg",
				"https://nineyu.com/fa2d4a35-0281-4d90-b71f-438e32892df8/seek/_3.jpg",
				"https://nineyu.com/fa2d4a35-0281-4d90-b71f-438e32892df8/seek/_4.jpg",
				"https://nineyu.com/fa2d4a35-0281-4d90-b71f-438e32892df8/seek/_5.jpg"
			];

		downloadImagesAndCreateVideo(imageUrls, {
			fps: 1,
			width: 300,
			height: 168,
			outputFormat: 'mp4'
		});

	}
